package com.xt.purchasingsystem.controller;


import com.xt.purchasingsystem.annotation.PurchaseCache;
import com.xt.purchasingsystem.service.SupplierApprovalDetailsService;
import com.xt.purchasingsystem.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author yhp
 * @since 2020-05-31
 */
@RestController
@RequestMapping("/supplierApprovalDetails")
public class SupplierApprovalDetailsController {
    @Autowired
    private SupplierApprovalDetailsService supplierApprovalDetailsService;

    /**
     * 根据供应商编号和产品编号查询对应的供应商申请审批明细
     * @param supplierId
     * @param productId
     * @return
     */
    @GetMapping("/{supplierId}/{productId}")
    @PurchaseCache(prefix = "supplierApprovalDetails:",timeout = 7200,random = 100)
    public Result getSupplierApprovalDetailsByProductId(@PathVariable String supplierId,@PathVariable String productId){
        return supplierApprovalDetailsService.getSupplierApprovalDetailsByProductId(supplierId,productId);
    };

}

